package com.terrynoya.fight.scriptEngine
{
	public class TokenNode
	{
		private var _chilren:Array;
		
		private var _token:TokenVO;
		
		private var _type:String;
		
		public function TokenNode(type:String,token:TokenVO = null)
		{
			this._type = type;
			this._chilren = new Array();
			this._token = token;
		}
		
		public function get chilrenLength():int 
		{
			return this._chilren.length;
		}
		
		public function getChildAt(index:int):TokenNode
		{
			return this._chilren[index];
		}
		
		public function get type():String
		{
			return _type;
		}

		public function set type(value:String):void
		{
			_type = value;
		}

		public function get token():TokenVO
		{
			return _token;
		}

		public function set token(value:TokenVO):void
		{
			_token = value;
		}

		public function addChild(value:TokenNode):void
		{
			this._chilren.push(value);
		}
		
		public function get value():String 
		{
			return this._token.value;
		}
	}
}